
var definition = {
    "page": {
        "height": "100%",
        "backgroundColor": "255,255,255",
        "width": "100%",
        "padding": 0,
        "backgroundImage": bgDefault,
        version: "1.5",
        isTakeOver: false
    },
    "elements": {

    }
};
var showCommentIco = true;
var localRuntime = false;
var chartId = 'banner';

$(function () {
    for(var i in Schema.shapes){
        MAXLENELEMENT[i] = Schema.shapes[i].maxlen;
    }
});
//轮播
var mySwiper={
    demoSwiper:"",
    sper:function(elem){
        mySwiper.demoSwiper = new Swiper (elem, {
            direction: 'horizontal',
            loop: true,
            autoplay : 6000,
            speed:300,
            pagination: '.swiper-pagination',
            nextButton: '.swiper-button-next',
            prevButton: '.swiper-button-prev',
            paginationClickable :true,
            autoplayDisableOnInteraction:false,
            observer:true,
            observeParents:true
        });
    }
};

$(function(){
    //侧栏隐藏
    $(document).on("click", ".leftMenuBtn", function (e) {
        $(".leftMenu").animate({width: 0},500,function(){
            $(this).css("overflow","hidden");
        });
        // $(".main").animate({"margin-left": 0},500,function(){
            $(".leftMenuShowBtn").addClass("leftMenuShow");
        // });
    });
    //侧栏显示
    $(document).on("click", ".leftMenuShowBtn", function (e) {
        $(".leftMenuShowBtn").removeClass("leftMenuShow");
        $(".leftMenu").animate({width:"50px"},500,function(){
            $(this).css("overflow","initial");
        });
        // $(".main").animate({"margin-left": "50px"},500);
    });

    $(".tcClosed").click(function(){
        $(this).parents(".wallPaperDiv").slideUp(100);
        $(this).parents(".tcBg").hide(0);
        $(".cpTc input").val("");
    });
    //其它按钮
    $(".otherBtn").click(function(){
        var elm=$(".otherBtnDiv");
        if(elm.css("display") === "block"){
            elm.slideUp(100);
        }else{
            elm.slideDown(100);
        }
    });
    $(".otherBtnDiv").on("click",".liItem",function(){
        $(".otherBtnDiv").slideUp(100);
    });
    //保存按钮
    $(".saveBtn").click(function(){
        $(".otherBtnDiv").slideUp(100);
        $(".saveTcBg").show(0);
    });
    //显示官方示例轮播
    $(".demoBtn").click(function(){
        $(".demoSwp").show();
        mySwiper.sper(".demoSwp");
    });

    //关闭官方示例轮播
    $(".demoSwp").on("click",".closeDemoSwp",function(){
        $(".demoSwp").hide();
    });

    //预览
    $(".tsdialog-look").on("click", function () {
        Dock.enterPresentation();
    });

    //退出预览
    $(".fullexit").on("click", function(){
        if (document.exitFullscreen) {
            document.exitFullscreen();
        }
        else if (document.mozCancelFullScreen) {
            document.mozCancelFullScreen();
        }
        else if (document.webkitCancelFullScreen) {
            document.webkitCancelFullScreen();
        }
        else if (document.msExitFullscreen) {
            document.msExitFullscreen();
        }
    });
    //屏显设置
    $(document).on("click",".pingXianSet",function(){
        $(".pxTcBg").show();
    });
});
